<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<div id="app">
<!--  标题只会替换没有名字的所有slot，有名字的slot不会被替换-->
  <cpn><span>标题</span></cpn>
<!--  亲亲会替换name为center的插槽-->
  <cpn><span slot="center">亲亲</span></cpn>
  <cpn><button slot="left">返回</button></cpn>
</div>

<template id="cpn">
  <div>
    <!--使用具名插槽：给slot元素一个name属性-->
    <slot name="left"><span>左边</span></slot>
    <slot name="center"><span>中间</span></slot>
    <slot name="right"><span>右边</span></slot>
    <slot>哈哈哈</slot>
  </div>
</template>

<script src="../js/vue.js"></script>
<script>
  const app=new Vue({
    el: '#app',
    data: {
      message: '你好'
    },
    components:{
      cpn:{
        template:'#cpn',
      }
    }
  })

</script>
</body>
</html>